package com.ecube.maintenance.components.widget;

import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.ecube.maintenance.R;
import com.ecube.maintenance.biz.commons.Constants;
import com.ecube.maintenance.biz.network.SimpleAsynTask;


public class ContactUsDialog {

	PopupDialogger dialogger;

	Context mContext;
	View contentView;
	TextView phoneView;

	public PopupDialogger getDialog() {
		return dialogger;
	}


	public ContactUsDialog(Context context) {
		mContext = context;
		contentView = createContentView();
	}
	
	private View createContentView(){
		
		View view = LayoutInflater.from(mContext).inflate(R.layout.popup_contact_us, null);
		phoneView = (TextView) view.findViewById(R.id.contact_phone);
		dialogger = PopupDialogger.createDialog(mContext);
        phoneView.setText("电话："+ Constants.CONTACT_US_PHONE);
        phoneView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });
		return view;
	}
	public void show(){
		dialogger.setTitleText("联系我们");
		dialogger.showDialog(mContext,contentView);
	}
	public void setTipText(String text){
		if ( phoneView == null )return;
		phoneView.setText(text);
	}
	public void setTipText(int textId){
		phoneView.setText(textId);
	}
}
